
function (extract_source_list source_list)
    IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.filelist)
        FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.filelist source_list_1)
    ELSE()
        set(source_list_1 "")
    ENDIF()

    SET(new_source_list "")
    FOREACH(infileName ${source_list_1})
        set(new_source_list ${new_source_list} ${CMAKE_CURRENT_SOURCE_DIR}/${infileName})
    ENDFOREACH(infileName)

    set(${source_list} ${new_source_list} PARENT_SCOPE)
endfunction()

function (extract_header_list header_list)
    IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.filelist)
        FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.filelist header_list_1)
    ELSE()
        set(header_list_1 "")
    ENDIF()

    SET(new_header_list "")

    FOREACH(infileName ${header_list_1})
        IF (infileName MATCHES ".*\.h$")
            set(new_header_list ${new_header_list} ${CMAKE_CURRENT_SOURCE_DIR}/${infileName})
        ENDIF()
    ENDFOREACH(infileName)

    set(${header_list} ${new_header_list} PARENT_SCOPE)
endfunction()
